// 日期格式 2022-11-25 11:34:09
function getTime(){
    var time  = new Date();
    var year = time.getFullYear()
    var month = time.getMonth()+1
    if(month<10){
        month = '0' + month
    }
    var date = time.getDate()
    if(date<10){
        date = '0' + date
    }
    var hours = time.getHours()
    if(hours<10){
        hours = '0' + hours
    }
    var minutes = time.getMinutes()
    if(minutes<10){
        minutes = '0' + minutes
    }

    var seconds = time.getSeconds()
    if(seconds<10){
        seconds = '0' + seconds
    }
   

    var res = year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds 
    return res
}


// 检测数据类型
function type(type) {

    let testType = Object.prototype.toString.call(type)
    console.log(typeof testType);

    return testType.slice(8, testType.length - 1);

}
export {getTime,type}
